<?php
/**
 * 登陆页面
 * User: tengyu
 * Date: 2017/8/23
 * Time: 17:16
 */?>
@extends('common.common')
@section('title','登陆')
@section('css')<link rel="stylesheet" href="{{asset('/css/login.css')}}">@endsection
@section('content')
    <div id="content">
        @if (count($errors) > 0)
            <div class="alert alert-danger text-left">
                <strong>登陆信息有误!</strong>
                <ul>
                    @if(is_object($errors))
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    @else
                        <li>{{$errors}}</li>
                    @endif
                </ul>
            </div>
        @endif
        <div class="container">
            <div class="loginBox">
                <img src="{{asset('/img/centerlogo.png')}}" alt="图标">
                <p class="miId"><h3>使用&nbsp;<span>芈租界ID</span>&nbsp;登录</h3></p>
                <form class="form-horizontal" action="{{url('/dologin')}}" method="post" onsubmit="return mzj_login()">
                    {!! csrf_field() !!}

                    <div class="form-group loginperson">
                        <input class="form-control" type="text" name="email" value="">
                        <b></b>
                    </div>
                    <div class="form-group loginpwd">
                        <input class="form-control" type="password" name="password" value="">
                        <b></b><i></i>
                    </div>
                    <!--自动登录-->
                    <div class="autoLogin">
                        <div>
                            <input type="checkbox" name="remember" @if( isset($_COOKIE['userid']) && $_COOKIE['userid'] !='')  checked  @endif>
                            <span>自动登录</span>
                        </div>
                        <div class="forgot">
                            <a href="{{url('/register')}}">注册ID</a>&nbsp;|
                            <a href="{{url('/forgetpw')}}">忘记密码?</a>
                        </div>
                    </div>
                    <div class="form-group">
                        <input class="btn btn-warning btn-block" type="submit" value="登录">
                    </div>
                </form>
                <script>
                    /**login校验*/
                    function mzj_login()
                    {
                        /**emial空校验*/
                        var email = $("input[name='email']").val();
                        if(!email){
                            $("input[name='email']").focus();return false;
                        }
                        /**password空校验*/
                        var password = $("input[name='password']").val();
                        if(!password){
                            $("input[name='password']").focus(); return false;
                        }
                        return true;
                    }
                </script>
                <div class="otherLogin">
                    <span>其他账号登录：</span>
                    <b><img src="{{asset('/img/weixin.png')}}" class="weixin"></b>&nbsp;&nbsp;
                    <b><img src="{{asset('/img/weibo.png')}}" class="weibo"></b>&nbsp;&nbsp;
                    <b><img src="{{asset('/img/qq.png')}}" class="qq"></b>
                </div>
            </div>
        </div>
    </div>
@endsection

